﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;

/// <summary>
/// 原GenFilePaths
/// </summary>
public static class MiaoFilePaths
{
    public const string DefsFolder = "Defs/";

    public static string OfficialModsFolderPath
    {
        get
        {
            return Path.Combine(MiaoInfo.GetFileInfoFullPath, "Data");
        }
    }

    public static string ModsFolderPath
    {
        get
        {
            return Path.Combine(MiaoInfo.GetFileInfoFullPath, "Mods");
        }
    }

    public static string ContentPath<T>()
    {
        if (typeof(T) == typeof(AudioClip))
        {
            return "Sounds\\";
        }
        else if (typeof(T) == typeof(Texture2D))
        {
            return "Textures\\";
        }
        else if(typeof(T) == typeof(string))
        {
            return "Strings\\";
        }
        throw new ArgumentException();
    }

    public static string ConfigFolderPath => Path.Combine(MiaoInfo.GetFileInfoFullPath, "Config");


    public static string ModsConfigFilePath => Path.Combine(ConfigFolderPath, "ModsConfig.txt");


    //public static string ConfigFolderPath => FolderUnderSaveData("Config");
    //public static string ModsConfigFilePath => Path.Combine(ConfigFolderPath, "ModsConfig.xml");


    //private static string FolderUnderSaveData(string folderName)
    //{
    //    string text = Path.Combine(SaveDataFolderPath, folderName);
    //    DirectoryInfo directoryInfo = new DirectoryInfo(text);
    //    if (!directoryInfo.Exists)
    //    {
    //        directoryInfo.Create();
    //    }
    //    return text;
    //}
}

